memory: fix return value handing of guest_remove_page()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 20 Jun 2017 12:39:56 +0000 (14:39 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 12:39:56 +0000 (14:39 +0200)
commitb614f642c35da5184416787352f51a6379a92628
tree2a2c100af6c1a47a3511bc846b32b7d9d03dec3d
parente7719a0dfac7a20cb7da5529e09773d8271bb78b
memory: fix return value handing of guest_remove_page()

Despite the description in mm.h, guest_remove_page() previously returned 0 for
paging errors.

Switch guest_remove_page() to having regular 0/-error semantics, and propagate
the return values from clear_mmio_p2m_entry() and mem_sharing_unshare_page()
to the callers (although decrease_reservation() is the only caller which
currently cares).

This is part of XSA-222.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/memory.c
xen/include/xen/mm.h